﻿Public Class Query_Form
    Dim grich As RichTextBox
    Dim i As Integer
    Dim f As Form
    Public Function gt(ByVal lrich As RichTextBox) As String
        grich = lrich
        ' f = a
        txtquery.Text = grich.Text
        Me.Show()
    End Function

    Private Sub btnsave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnsave.Click
        Dim str As String
        str = txtquery.Text
        str = UCase(str)
        If (str.Contains("INSERT") = True) Or (str.Contains("DELETE") = True) Or (str.Contains("UPDATE") = True) Or (str.Contains("ALTER") = True) Then
            MsgBox("INSERT, DELETE, UPDATE or ALTER operation are not allowed in general Query Form")
            Exit Sub
        End If
        grich.Text = txtquery.Text
        Me.Close()
    End Sub

    Private Sub btnclose_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnclose.Click
        Me.Close()
    End Sub

    Private Sub Query_Form_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load

    End Sub
End Class